/*
 * Copyright (c) 2018-2999 九五云信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 */

package com.yami.shop.api.controller;


import com.yami.shop.bean.model.WebConfig;
import com.yami.shop.service.WebConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author SJL
 * @date 2021-02-20 09:44:42
 */
@RestController
@AllArgsConstructor
@RequestMapping("/webConfig")
@Api(tags = "网站配置接口")
public class WebConfigController {

    private final WebConfigService webConfigService;

    /**
     * 获取当前激活的PC端网站配置
     *
     * @return
     */
    @GetMapping("/getPcWebConfig")
    @ApiOperation(value = "获取PC端网站配置")
    public WebConfig getWebConfig() {
        return webConfigService.getActivityWebConfig(2);
    }

    /**
     * 获取当前激活的H5端网站配置
     *
     * @return
     */
    @GetMapping("/getUniWebConfig")
    @ApiOperation(value = "获取H5端网站配置")
    public WebConfig getUniWebConfig() {
        return webConfigService.getActivityWebConfig(3);
    }
}
